import request from '../http';
import {Home} from '../index';

export const getHomeArticleListApi = () => {
  return request<Home.HomeArticleListRes>('get', 'article/home');
};

export const getHomeCommodityListApi = () => {
  return request<Home.HomeCommodityListRes>('get', 'commodity/list');
};

export const getHomeAddressListApi = () => {
  return request<Home.HomeAddressListRes>('get', 'address/list');
};

export const getArticleInfoApi = (id: number) => {
  return request<Home.ArticleInfo>('get', `article/info?id=${id}`);
};

export const getAllArticleListApi = (params: object) => {
  return request<Home.AllArticleListRes>('post', 'article/all', params);
};
